<h1 class="right">ادارة سندات الصرف</h1><!--<div class="h1-dot"></div><a href="#add_client" class="add_furnitures_pop">
  <img src="images/add-icon.png" align="left" class="left" alt=""/>
</a> -->
<div id="add_client" class="zoom-anim-dialog mfp-hide view-booking-popup">
	<?php require("payment_vouchers/create.php"); ?>
</div>
<span class="left grey medium margin-left11 margin-top5"><?php echo date('g:ia d/m/Y');?></span>
<div class="clear"></div>
<div id="dashboard-container">
<div class="customers-filter">
    	<form  name="payment_search" id="searchClient" method="POST" action="" id="searchClient">
      <table class="furnitures-filter">
        <tr>
              
                <td style="width:18px;">من</td>
                <td style="width:70px; padding-left:20px;"><input type="text" class="auto-input" id="from-0" name="from" value="<?php if(isset($binds['from']) ) {echo $binds['from'];} ?>"></td>
                <td style="width:25px;">الى</td>
                <td style="width:70px; padding-left:20px;"><input type="text" class="auto-input" id="to-0" name="to" value="<?php if(isset($binds['to']) ) {echo $binds['to'];} ?>"></td>
                <td style="width:105px;">رقم العقد / الحجز</td>
                <td style="width:70px; padding-left:20px;"><input type="text" class="auto-input" name="contract_id" value="<?php if(isset($binds['contract_id']) ) {echo $binds['contract_id'];} ?>"></td>
                <td style="width:62px;">رقم السند</td>
                <td style="width:70px; padding-left:20px;"><input type="text" class="xsmall-input" name="payment_id" value="<?php if(isset($binds['payment_id']) ) {echo $binds['payment_id'];} ?>"></td>
                
                <td style="width:60px"><a href="#"><div class="search-botton">بحث</div></a></td>
                
            </tr>
      </table>
      </form>
    </div>
	<div class="dashboard-row">
    
    	<table class="customers-table">
        	<thead>
        	<tr class="customers-table-head">
            	<td widthf="160px">رقم السند</td>
                
                <td widthf="100px">رقم العقد / الحجز</td>
                <td widthf="110px">دفع لـِ</td>
                <td widthf="100px">المبلغ</td>
                <td widthf="100px">من أجل </td>
                
                <td widthf="100px">أمين الصندوق</td>
                <td widthf="100px">التاريخ</td>
                <td widthf="100px">العمليات</td>
            </tr>
            </thead>
			<?php
			 if(!empty($payments)) { 
      foreach($payments as $payment){
			
			?>
                <tr class="page1">
                    <input class="client-id" type="hidden" value=""/>
                    <td ><?php echo $payment['payment_id']; ?></td>
                    
                    <td ><?php echo $payment['contract_id']; ?></td>
                    <td ><?php echo $payment['recipient']; ?></td>
                    <td ><?php echo $payment['amount']; ?></td>
                     <td ><?php echo $payment['reason']; ?></td>
                    
                    <td ><?php echo $payment['amen_sondoq'] ;?></td>
                    <td > <?php echo $payment['Hijri_date'] ;?></td>
                    <td class="white-bg">
                      <a href="view-pop-ups/payment.php?id=<?php echo $payment['payment_id']; ?>" class="ajax-pop-up-magnific-modal">
                        <img src="images/view.png" class="" align="" alt="View" title="عرض السند"/>
                      </a>
                      <?php if($payment['contract_status'] != 3&&$_SESSION['r']<=1){ ?>
                      <a href="edit-pop-ups/payment.php?id=<?php echo $payment['payment_id']; ?>" class="ajax-pop-up-magnific-modal">
                        <img src="images/edit.png" class="" align="" alt="edit" title="تعديل السند"/>
                      </a>
                      <a href="#" class="delete"><img src="images/x.png" class="margin-right5" align="" alt="Delete"/></a>
                      <input class="delete-id" type="hidden" value="<?php echo $payment['payment_id']; ?>"/>
                      <input class="filter-id" type="hidden" value="5"/> <!-- 5 means delete payment vouchers -->
                      <?php } ?>
                </tr>
				<?php }
            }
        ?>
                </table>
				
    </div> 
	
	<?php
          $start = $page * 20 -19;
          $end  = $start + 19;
          if($end > $totalPages)
            $end = $totalPages;
          
	  if(!empty($payments)) { ?>
        <div class="clear"></div>
        <div class="relative">
          <span class="middle xsmall showing-results absolute">عرض النتائج <?php echo $start; ?> - <?php echo $end; ?> من إجمالى <?php echo $totalPages; ?></span>
          <div id="payment-selection" class="center"></div>
        </div>
        <div class="hidden totalPages"><?php if(isset($totalPages)) {echo $totalPages;} ?></div>
        <div class="hidden currentPage"><?php if(isset($page)) {echo $page;} ?></div>
        <?php } ?>
	 
         <div class="clear"></div>                    
</div>
<br />